//--------------------------------------------------- // Purpose: Program to calculate magic numbers // Author: John Gauch //--------------------------------------------------- #include using namespace std; // Function to calculate magic number int Magic(const int Number) { // Dummy code return 42; } // Main body of program int main() { // Get user input int Input, Output; cout << "Enter number in [0..99999] range: "; cin >> Input; // Do error checking if ((Input < 0) || (Input > 99999)) cout << "Number must be in [0..99999]" << endl; // Calculate magic number and print results else { cout << "Input = " << Input << endl; Output = Magic(Input); cout << "Output = " << Output << endl; } return 0; }